
{extend name="public:base" /}
{block name='header'}
{/block}
{block name="main"}
<div class="ShareAnyContainer" style="font-size: 14px;">
    当前位置：<a href="{:url('shop/index/index')}" title="首页">首页</a>&nbsp;&nbsp;/&nbsp;&nbsp;
    <a href="{:url('/shop/artwork/cart')}" title="购物车">购物车</a>&nbsp;&nbsp;/&nbsp;&nbsp;
    <a href="javascript:;" title="加入购物车">加入购物车</a>
</div>
<div class="ShareAnySeparate"></div>
<div class="ShareAnyContainer">
    <div style="text-align: center;font-size: 20px;font-weight: bold;">加入购物车成功</div>
</div>
{/block}

{block name="footer"}
<script type="text/javascript">jQuery(".picFocus").slide({ mainCell:".bd ul",effect:"left",autoPlay:true });</script>
<script>
    (function ($) {
        window.magnifier = function (basePhotoClass, showPhotoClass, scale) {
            var basePhoto = $("." + basePhotoClass);
            var showPhoto = $("." + showPhotoClass);
            var showWidth = showPhoto.width();
            var showHeight = showPhoto.height();;

            // basePhoto.each(function(){
            //     $(this).parent().css("width", $(this).width() + "px");
            //     $(this).parent().css("height", $(this).height() + "px");
            // });

            // basePhoto.parent().css("position", "relative");

            // basePhoto.css("position", "absolute");
            // basePhoto.css("cursor", "pointer");
            showPhoto.css("background-repeat", "no-repeat");

            showPhoto.hide();

            basePhoto.on("mouseout", function (e) {
                showPhoto.hide();
            });

            basePhoto.on("mousemove", function (e) {
                var thisLeft = e.pageX - $(this).offset().left;
                var thisTop = e.pageY - $(this).offset().top;
                var thisWidth = $(this).width();
                var thisHeight = $(this).height();
                var showBackgroundWidth = thisWidth * scale;
                var showBackgroundheight = thisHeight * scale;
                var backgroundPositionLeft = (showWidth / 2 - thisLeft * scale);
                var backgroundPositionTop = (showHeight / 2 - thisTop * scale);

                if (backgroundPositionLeft > 0) {
                    backgroundPositionLeft = 0;
                }
                if (backgroundPositionLeft < (showWidth - showBackgroundWidth)) {
                    backgroundPositionLeft = (showWidth - showBackgroundWidth);
                }
                if (backgroundPositionTop > 0) {
                    backgroundPositionTop = 0;
                }
                if (backgroundPositionTop < (showHeight - showBackgroundheight)) {
                    backgroundPositionTop = (showHeight - showBackgroundheight);
                }

                showPhoto.css("background-position", backgroundPositionLeft + "px " + backgroundPositionTop + "px");
                showPhoto.css("background-size", showBackgroundWidth + "px " + showBackgroundheight + "px");
                showPhoto.css("background-image", "url(" + $(this).attr("src") + ")");
                showPhoto.show();
            });

        };
    })(jQuery);

    $(window).load(function () {
        window.magnifier("photo", "photo_show", 2);
    });
</script>
{/block}